<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/11/9
  Time: 18:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="icon" href="${pageContext.request.contextPath}/assets/images/favicon.png" type="image/png">
    <link href="${pageContext.request.contextPath}/assets/css/icons.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/style.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/responsive.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/assets/css/update.css">
    <style>
        .form-group label {
            padding-right: 0;
        }

        label {
            font-size: 16px;
        }

        .form-group input {
            border-radius: 8px;
        }

        .text-body2 .form-group {
            margin-top: 10px;
        }

        .form-group .inputPic {
            width: 100%;
        }
    </style>
</head>
<body>
<%@include file="../inc/left.jsp" %>
<div class="main-content">
    <%@include file="../inc/header.jsp" %>
    <div class="text-body">
        <div class="text-body1" style="position: relative">
            <div class="text-body2" id="bod2">
                <form class="form-horizontal" action="${pageContext.request.contextPath}/sell/tool" method="post" enctype="multipart/form-data">
                    <input name="id" value="${advertise.id}" style="display: none">
                    <div class="form-group">
                        <label for="inputName" class="col-sm-3 control-label">广告名称：</label>
                        <div class="col-sm-7">
                            <input type="text" class="form-control" id="inputName" name="name" value="${advertise.name}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputPassword" class="col-sm-3 control-label">广告位置：</label>
                        <div class="col-sm-6">
                            <select id="inputPassword" name="type" class="form-control">
                                <option value="1" >app首页轮播</option>
                                <option value="0">pc首页轮播</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputStartTime" class="col-sm-3 control-label">开始时间：</label>
                        <div class="col-sm-6">
                            <input required="required" type="datetime-local" step="1" class="form-control" id="inputStartTime" name="startTime" placeholder="开始时间" value='<fmt:formatDate value="${advertise.startTime}" pattern="yyyy-MM-dd HH:mm:ss"/>'>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEndTime" class="col-sm-3 control-label">结束时间：</label>
                        <div class="col-sm-6">
                            <input required="required" type="datetime-local" step="1" class="form-control" id="inputEndTime" value='<fmt:formatDate value="${advertise.endTime}" pattern="yyyy-MM-dd HH:mm:ss"/>' name="endTime">
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">上线/下线：</label>
                        <div class="form-radio">
                            <input type="radio"  class="input-radio" name="status" value="1" ${advertise.status==1?"checked":""}><span style="padding-right: 50px">上线</span>
                            <input type="radio" class="input-radio" name="status" value="0" ${advertise.status==0?"checked":""}> <span>下线</span>
                        </div>
                    </div>
                    <div class="form-group" style="padding-bottom: -10px">
                        <label class="col-sm-3 control-label" for="inputPic">广告图片：
                            <div class="col-sm-10 inputPic" >
                                ${advertise.pic==null?"点击上传":"请重新上传"}
                            </div>
                        </label>
                        <p style="position: relative;top: 45px;left: 15px">只能上传jpg/png文件，且不超过10MB</p>
                        <input required="required" type="file" name="file" id="inputPic" style="display: none">
 				<img src="${advertise.pic}"  class="img-rounded" style="width: 120px;height:80px;margin-left: 200px;margin-top: -60px;display: ${advertise.pic!=null?"":"none"}" aria-required="true">
                    </div>
                    <div class="form-group">
                        <label for="order" class="col-sm-3 control-label">排序：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="order" name="sort" value="${advertise.sort}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="url" class="col-sm-3 control-label">广告链接：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" id="url" name="url" value="${advertise.url}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="note" class="col-sm-3 control-label">广告备注：</label>
                        <div class="col-sm-6">
                            <textarea id="note" name="note" class="form-control" placeholder="请输入内容">${advertise.note}</textarea>
                        </div>
                    </div>
                    <div class="col-sm-offset-3">
                        <button class="btn-primary btn-button " style="margin-right: 20px">提交</button>
                    </div>
                </form>
            </div>
            <button class="btn-button1" id="res" style="margin-left: 263px;position: relative;top: -20px">重置</button>
            <a class="btn" href="${pageContext.request.contextPath}/sell/advertise" style="position: absolute;top: 0px;right: 0"><i class="fa fa-times"></i></a>
        </div>


    </div>

</div>

</body>

<script src="${pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/assets/plugins/moment/moment.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/jquery.slimscroll.js "></script>
<script src="${pageContext.request.contextPath}/assets/js/jquery.nicescroll.js"></script>
<script src="${pageContext.request.contextPath}/assets/js/functions.js"></script>
<script>
    $("#res").click(function () {
        console.info(33)
        $("#bod2 input").val('')

    })

</script>
</html>
